<?php

namespace app\samples\controllers;

use yii\web\Controller;

class DefaultController extends Controller
{
    public function actionIndex()
    {
        return $this->render('index');
    }

    public function actionBoxes(){
        return $this->render('boxes');
    }

    public function actionCharts(){
        return $this->render('charts');
    }

    public function actionMessage(){
        return $this->render('message');
    }

    public function actionButtons(){
        return $this->render('buttons');
    }

    public function actionIcons(){
        return $this->render('icons');
    }

    public function actionEditor(){
        $value = $content = isset($_REQUEST['ckEditor']) ? $_REQUEST['ckEditor'] : "";
        preg_match_all("/<img.+src=[\"\'](.+?)[\"\'].+>/i", $content, $matches, PREG_SET_ORDER);
        $content = var_export($matches, true);
        return $this->render('editor',[
            'content' => $content,
            'value' => $value
        ]);
    }

    public function actionJcrop(){
        return $this->render('jcrop');
    }
}
